<div class="tableform">
<div class="division widgetconfig" style="margin:-5px 0 0 0">
    <table width="100%" cellpadding="0" cellspacing="0">
      <tr>
        <th><{t app='b2c'}>版块宽度:<{/t}></th><td><input name='width' value="<{$setting.width}>" size="4"></td>
        <th><{t app='b2c'}>版块高度:<{/t}></th><td><input name='height' value="<{$setting.height}>" size="4"></td>
      </tr>
    </table>
</div>
</div>

<div id="picAddress" class="tableform widgetconfig">

<div class="division widgetconfig" style="margin:-5px 0 0 0">

  <{button label=$___b2c="添加图片"|t:'b2c' app="desktop" icon="btn_add.gif" onclick="addPic()"}> <{t app='b2c'}>(要看出效果，请至少添加两张图片)<{/t}>

      <{foreach from=$setting.pic item=data key=key}>
		<table id="pic_<{$data.id}>" width="100%" cellpadding="0" cellspacing="0">
			  <tr>
			    <th><{t app='b2c'}>链接图片地址:<{/t}></th>
			    <td colspan="3">
                  <input name=pic[<{$data.id}>][link] value="<{$data.link}>" size="50">
		        </td>
		        <td>
		        <span onclick="delLink('pic_<{$data.id}>');"><{img src='delecate.gif' style='cursor:pointer;' alt=$___b2c="删除"|t:'b2c' title=$___b2c="删除"|t:'b2c'}></span>
		        </td>
		      </tr>
		</table>
      <{/foreach}>
</div>
</div>

<script>
function addPic(){
  var d=new Date();
  var i=d.getTime();
  $('picAddress').getElement('.division').innerHTML+='\
  <table id="pic_'+i+'" width="100%" cellpadding="0" cellspacing="0"><tr><th><{t app='b2c'}>链接图片地址:<{/t}></th><td>\
    <input type=hidden name=pic['+i+'][id] value="'+i+'">\
      <input name=pic['+i+'][link]></td>\
      <td><span onclick="delLink(\'pic_'+i+'\');"><{img src="delecate.gif" style="cursor:pointer;" alt=$___b2c="删除"|t:'b2c' title=$___b2c="删除"|t:'b2c'}></span>\
  </td></tr></table>\
';
}
function delLink(o){
  $(o).destroy();
}
</script>
